home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / superdog.swf / scripts / DefineSprite_1170 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-06-25  |  860 b   |  43 lines

  1. var noHit = true;
  2. var dix = true;
  3. var long = 0;
  4. var spd = 2;
  5. _parent._parent.enemy_array.push(this._name);
  6. this.swapDepths(100 + _parent._parent.dep++);
  7. stop();
  8. onEnterFrame = function()
  9. {
  10.    if(_parent._parent.pauses == false)
  11.    {
  12.       if(dix == false)
  13.       {
  14.          this._y -= spd;
  15.          long += spd;
  16.       }
  17.       else
  18.       {
  19.          this._y += spd;
  20.          long += spd;
  21.       }
  22.       if(long >= 70)
  23.       {
  24.          long = 0;
  25.          if(dix == false)
  26.          {
  27.             dix = true;
  28.          }
  29.          else
  30.          {
  31.             dix = false;
  32.          }
  33.       }
  34.       if(this.fk.hitTest(_parent._parent.man.fk) and _parent._parent.yinc > 0)
  35.       {
  36.          _parent._parent.yinc = -10;
  37.          _parent._parent.inAir = true;
  38.          delete this.onEnterFrame;
  39.          this.play();
  40.       }
  41.    }
  42. };
  43.